import axios from '../config/AxiosConfig';
import { Result } from '../domain/entity/Result';
import { UserInfo } from '../domain/entity/UserInfo';

const moduleUrl = "";

const loginUrl = moduleUrl + "/login";
const logoutUrl = moduleUrl + "/logout";
const getUserInfoUrl = moduleUrl + "/getUserInfo";

export const login = function(username: string, password: string) {
    return axios.post<Result<UserInfo>>(loginUrl,{username, password});
}

export const logout = function() {
    return axios.delete(logoutUrl);
}

export const getUserInfo = function() {
    return axios.get(getUserInfoUrl);
}
